import * as types from '@/store/mutation-types';

export default {
  state: {
    isShow: false,
  },
  mutations: {
    [types.SHOW_LOADING](state) {
      state.isShow = true;
    },
    [types.HIDE_LOADING](state) {
      state.isShow = false;
    },
  },
  actions: {

    // * 显示loading
    showLoading({ commit }) {
      commit(types.SHOW_LOADING);
    },

    // * 隐藏loading
    hideLoading({ commit }) {
      commit(types.HIDE_LOADING);
    },
  },
};
